package com.yang.service.api;

import com.yang.service.model.dto.post.AddrPostDTO;
import com.yang.service.model.dto.post.OderPostDTO;
import com.yang.service.model.dto.put.AddrPutDTO;
import com.yang.service.model.vo.AddrVo;
import com.yang.service.model.vo.OderVO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import javax.validation.Valid;
import java.util.List;

/**
 * Created by xin7k
 * Date: 2019/12/17 0017
 */
@FeignClient(name = "${zhy.endpoint.basedata}")
public interface OderService {
    /**
     * 新增订单
     */
    @PostMapping("oder")
    boolean save(@RequestBody @Valid List<OderPostDTO> dtos,@RequestParam(value = "userId") String userId);

    /*
    * 获取所有订单
    * */
    @GetMapping("oder/list")
    List<OderVO> listAllOderByUserId(@RequestParam(value = "userId") String userId);

    /**
     * 根据订单Id查询详情
     */
    @GetMapping("oder/{id}")
    OderVO getOderByOderId(@PathVariable("id") String id);


}
